/*2. Implement rotate function for forward-only iterators.

Clarification: with O(1) additional memory. Rotate semantics should be that of std::rotate.

I personally know a O(n*log(n)) solution which takes O(log(n)) extra memory, and I assume it should be possible to reduce memory costs to O(1).*/


/*
template <class ForwardIterator>
  void rotate ( ForwardIterator first, ForwardIterator middle,
                ForwardIterator last )
{
  ForwardIterator next = middle;
  while (first!=next)
  {
    swap (*first++,*next++);
    if (next==last) next=middle;
    else if (first == middle) middle=next;
  }
}
*/



